import requests

# POST提交表单
# u = requests.post("http://127.0.0.1:8000/api/user/", data={"username": "zhangshan", "password": "123456"})
# u.raise_for_status()
# print(u.json())

# GET请求
# r = requests.get("http://127.0.0.1:8000/api/user/")
# r.raise_for_status()
# print(r.json())

# 上传文件
files = {"file": open("./test.py", "rb"),
         "file1": open("./douban.txt", "rb")}

r = requests.post("http://127.0.0.1:8000/upload/", files=files)
print(r.text)
